package com.ving.test.mybatis02.session;

import com.ving.test.mybatis02.binding.MapperProxy02;

import java.lang.reflect.Proxy;

/**
 * Created by liuweijie on 2019-11-19.
 */
public class DefaultSqlSession02 {

    private Configuration02 configuration02;

    public DefaultSqlSession02(Configuration02 configuration02) {
        this.configuration02 = configuration02;
    }

    public <T> T getMapper( Class<T> zlass){

        return (T) Proxy.newProxyInstance(zlass.getClassLoader(),new Class[]{zlass},new MapperProxy02(configuration02,zlass));
    }
}
